package com.itheima.domain;

import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Max;
import javax.validation.constraints.Size;
import java.io.Serializable;

public class User implements Serializable {

    private Integer id;
    @NotBlank(message = "用户名不能为空")
    @Size(message = "用户名长度必须在2-16之间", max = 16, min = 2)
    private String password;


    @NotBlank(message = "密码不能为空")
    @Size(message = "密码长度必须在6-16之间", max = 16, min = 6)
    private String username;

    public User(Integer id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }

    public User() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
